package liudan.archetype.action;


import liudan.archetype.form.ActionForm;
import liudan.archetype.form.RegisterForm;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Description:
 * Title
 * Copyright: Copyright (c) 2017
 * User: liudan
 * Created on 2017/2/17 16:23
 */
public class RegisterAction extends Action {
    @Override
    public String execute(ActionForm form, HttpServletRequest request, Map<String, String> forwardMap) {
        RegisterForm registerForm = (RegisterForm) form;
        System.out.println(registerForm.toString());
        if (registerForm != null) {
            request.setAttribute("message", "注册成功");
            return forwardMap.get("success");
        } else {
            request.setAttribute("message", "注册失败");
            return forwardMap.get("faile");
        }
    }
}
